package com.example.listossimage.service.impl;

import com.example.listossimage.entity.esPo.Book;
import com.example.listossimage.repository.esRepository.ESBookRepository;
import com.example.listossimage.service.BookService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class BookServiceImpl implements BookService {


//    @Autowired
//    private ESBookRepository esBookRepository;
//
//    @Override
//    public void addBook(Book book) {
//        try {
//            esBookRepository.save(book);
//        }catch (Exception e){
//            log.error(String.format("保存ES错误！%s", e.getMessage()));
//        }
//    }
//
//    @Override
//    public List<Book> searchBook(String keyword) {
//        return esBookRepository.findByTitleOOrAuthor(keyword, keyword);
//    }
//
//    @Override
//    public SearchHits<Book> searchBook1(String keyword) {
//        return esBookRepository.find(keyword);
//    }
}
